import platform
import json


class Static(object):
    def __readJSON(self, key):
        with open("config/config.json", "r+", encoding="utf-8") as f:
            com = f.read()
        text = json.loads(com)
        value = text[key]
        return value

    MYSQL_host = "localhost"
    MYSQL_user = "root"
    MYSQL_pwd = "root"
    MYSQL_DB = "hospital"
    MYSQL_PORT = 3306
    DB_connect_address = "mysql+pymysql://{}:{}@{}:{}/{}?charset=utf8".format(
        MYSQL_user, MYSQL_pwd, MYSQL_host, MYSQL_PORT, MYSQL_DB
    )

    DB_User = "user"
    DB_Patient = "patient"
    DB_Record = "record"
    DB_Department = "department"
    DB_SystemDict = "system"
    DB_Refer = "refer"

    SYSTEM_SUPER_NAME = "admin"
    SYSTEM_SUPER_NICK = "管理员"
    SYSTEM_SUPER_PWD = "topsky"
    SYSTEM_SUPER_PHONE = "6660383"
    SYSTEM_SUPER_GENDER = "1"
    ROLE_ADMIN = "99"
    ROLE_NORMAL = "1"

    USER_DEFAULT_PWD = "123"

    SYSTEM_KEY_SECRET = "topsky"
